﻿@model Chaine.Models.EmailTemplateModels
@{
    ViewBag.Title = "Edit Email Template: " + Model.Type;
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section maincontent{
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/js/ckeditor/ckeditor.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $().ready(function () {
            CKEDITOR.replace("Content");
        });
    </script>
    @using (Html.BeginForm())
    {
       
        @Html.HiddenFor(m => m.Type)
        @Html.ValidationSummary(true)
        <div class="form-horizontal">
            <fieldset>
                <legend>@ViewBag.Title</legend>
                <div class="control-group">
                    <label class="control-label">
                        From Name</label>
                    <div class="controls">
                        @Html.EditorFor(m => m.FromName)
                        @Html.ValidationMessageFor(m => m.FromName)
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                        From Email</label>
                    <div class="controls">
                        @Html.EditorFor(m => m.FromEmail)
                        @Html.ValidationMessageFor(m => m.FromEmail)
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                        Title</label>
                    <div class="controls">
                        @Html.EditorFor(m => m.Title)
                        @Html.ValidationMessageFor(m => m.Title)
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                        Content</label>
                    <div class="controls">
                        @Html.ValidationMessageFor(m => m.Content)
                        @Html.TextAreaFor(m => m.Content, new { style = "width:400px;height:170px;" })
                    </div>
                </div>
                <div class="form-actions">
                    <input type="submit" value="Save" class="btn btn-primary btn-large" />
                    @Html.ActionLink("Cancel", "index", "AdminEmail", null, new { @class = "btn btn-large" })
                </div>
            </fieldset>
        </div>
    }
}
@section sidebar{
    @Html.Partial("~/views/shared/_adminSidebar.cshtml")
}
